(window.webpackJsonpvtex_product_summary_2_91_0=window.webpackJsonpvtex_product_summary_2_91_0||[]).push([["ProductSummaryImage"],{0:function(e,t){e.exports=React},10:function(e,t){e.exports=ReactIntl},108:function(e,t,r){"use strict";r.r(t);var a=r(11),i=r(0),n=r.n(i),o=r(40),u=r.n(o),c=r(41),l=r.n(c),m=r(7),s=r.n(m),d=r(53),p=r.n(d),v=r(63),g=r.n(v),h=r(5),f=r.n(h),x=r(38),y=r.n(x),b=r(6),C=r.n(b),I=r(10),E=r(42),_=r(3),w=r.n(_),S=r(22),N=function(e,t,r,i){var n,o=t,u="auto";return i&&"auto"!==i?(u=t*(null!==(n=function(e){if(!e)return null;if("string"==typeof e){if("auto"===e)return null;var t=e.split(":");if(2!==t.length)return null;var r=Object(a.a)(t,2),i=r[0],n=r[1],o=parseFloat(n)/parseFloat(i);return"number"!=typeof o||Number.isNaN(o)?null:o}return"number"==typeof e?e:null}(i))&&void 0!==n?n:1),o>r&&(u/=o/r,o=r),u>r&&(o/=u/r,u=r),o=Math.round(o),u=Math.round(u)):o=Math.min(r,o),Object(S.a)(e,o,u)},P=C.a.useProductSummary,O=["image","imageWrapper","imageContainer","product","imagePlaceholder","mainImageHovered"];function R(e){var t=e.src,r=e.width,a=e.height,i=e.dpi,n=e.aspectRatio;return r||a?Object(S.a)(t,r*i,a*i):n?N(t,300,500,n):t}function L(e){var t=e.images,r=e.hoverImage,a=e.hoverImageLabel,i=null!=r?r:{},n=i.criteria,o=void 0===n?"label":n,u=i.label,c=void 0===u?a:u,l=i.labelMatchCriteria,m=void 0===l?"exact":l,s=i.index;return"label"===o?j(t,c,m):"index"===o?function(e,t){return null==t||Number.isNaN(t)?null:e[t]}(t,s):null}function B(e){var t=e.width,r=e.height,a=e.aspectRatio,i=e.maxHeight;return t||r?{width:"100%",height:r,objectFit:"contain",maxHeight:"unset",maxWidth:t}:a||i?{width:"100%",height:"100%",objectFit:"contain",maxHeight:null!=i?i:"unset"}:void 0}function M(e){var t=e.showCollections,r=e.productClusters,a=e.children;if(!t||!r||0===r.length)return n.a.createElement(n.a.Fragment,null,a);var i=r.map((function(e){return e.name}));return n.a.createElement(u.a,{collectionBadgesText:i},a)}function H(e){var t=e.showBadge,r=e.commertialOffer,a=e.badgeText,i=e.children;return t?n.a.createElement(l.a,{listPrice:r.ListPrice,sellingPrice:r.Price,label:a},i):n.a.createElement(n.a.Fragment,null,i)}function j(e,t,r){return t?"contains"===r?e.find((function(e){var r=e.imageLabel;return null==r?void 0:r.includes(t)})):e.find((function(e){return e.imageLabel===t})):null}function k(e){var t=e.src,r=e.width,a=e.height,i=e.onError,o=e.alt,u=e.className,c=e.aspectRatio,l=e.maxHeight,m=e.fetchpriority,s=void 0===m?"auto":m,d=p()().isMobile?2:1;return n.a.createElement("img",{src:R({src:t,width:r,height:a,dpi:d,aspectRatio:c}),style:B({width:r,height:a,aspectRatio:c,maxHeight:l}),loading:"low"===s?"lazy":"eager",alt:o,className:u,onError:i,fetchpriority:s})}function T(e){var t,r,o,u,c,l,m,d,v,h=e.showBadge,x=void 0===h||h,b=e.badgeText,C=e.displayMode,_=void 0===C?"normal":C,S=e.mainImageLabel,N=void 0===S?"":S,R=e.hoverImageLabel,B=void 0===R?"":R,T=e.hoverImage,A=e.showCollections,F=void 0!==A&&A,U=e.placeholder,D=e.width,W=e.height,V=e.aspectRatio,K=e.maxHeight,q=e.classes,z=e.fetchpriority,J=void 0===z?"byPosition":z,Z=P(),Q=Z.product,G=Z.position,X=f()(O,{classes:q}),Y=X.handles,$=X.withModifiers,ee=Object(I.useIntl)(),te=Object(i.useState)(!1),re=Object(a.a)(te,2),ae=re[0],ie=re[1],ne=function(){return ie(!0)},oe=p()().isMobile,ue=(null!==(t=y()())&&void 0!==t?t:{}).skuSelector,ce=(ue=void 0===ue?{}:ue).selectedImageVariationSKU,le=null!=Q?Q:{},me=le.productClusters,se=le.productName,de=null==Q?void 0:Q.sku,pe=g()({widthProp:D,heightProp:W,aspectRatioProp:V,maxHeightProp:K}),ve=pe.widthProp,ge=pe.heightProp,he=pe.aspectRatioProp,fe=pe.maxHeightProp,xe=s()(w.a.imageContainer,Y.imageWrapper,"inline"!==_&&"db w-100 center"),ye=[parseFloat(null!==(r=null!=ve?ve:ge)&&void 0!==r?r:0),parseFloat(null!==(o=null!=ge?ge:ve)&&void 0!==o?o:0)],be=ye[0],Ce=ye[1],Ie=s()(w.a.imageStackContainer,!oe&&w.a.hoverEffect),Ee=s()("dib relative",Y.imageContainer,Ie),_e=null!==(c=null===(u=null==de?void 0:de.image)||void 0===u?void 0:u.imageUrl)&&void 0!==c?c:"",we=!_e||ae;if(!U&&we)return n.a.createElement("div",{className:xe},n.a.createElement("div",{className:Ee},n.a.createElement(E.a,{cssHandle:Y.imagePlaceholder})));var Se=null!==(l=null==de?void 0:de.images)&&void 0!==l?l:[],Ne=L({images:Se,hoverImage:T,hoverImageLabel:B});if(null==ce&&N){var Pe="string"==typeof N?j(Se,N):j(Se,N.label,N.labelMatchCriteria);Pe&&(_e=Pe.imageUrl)}var Oe=s()("inline"===_?w.a.imageInline:w.a.imageNormal),Re=null!==(v=null===(d=null===(m=Q.sku)||void 0===m?void 0:m.seller)||void 0===d?void 0:d.commertialOffer)&&void 0!==v?v:{},Le=s()(Oe,Y.image,Boolean(Ne)&&Y.mainImageHovered),Be=s()("w-100 h-100 dn absolute top-0 left-0 z-999",$("image","hover"),Oe,!oe&&w.a.hoverImage),Me=function(e,t){return t?e?1===t?"high":"low":t<3?"high":"low":"low"};return n.a.createElement("div",{className:xe,"aria-label":ee.formatMessage({id:"store/product-summary.image.aria-label"},{productName:Q.productName})},n.a.createElement(M,{showCollections:F,productClusters:me},n.a.createElement(H,{showBadge:x,commertialOffer:Re,badgeText:b},n.a.createElement("div",{className:Ee},n.a.createElement(k,{src:we?U:_e,width:be,height:Ce,aspectRatio:he,maxHeight:fe,alt:se,className:Le,onError:ne,fetchpriority:"byPosition"===J?Me(oe,G):J}),Ne&&!oe&&n.a.createElement(k,{src:Ne.imageUrl,width:be,height:Ce,aspectRatio:he,maxHeight:fe,alt:se,className:Be,onError:ne,fetchpriority:"byPosition"===J?Me(oe,G):J})))))}T.schema={title:"admin/editor.productSummaryImage.title",description:"admin/editor.productSummaryImage.description",type:"object",properties:{showBadge:{type:"boolean",title:"admin/editor.productSummary.showBadge.title",default:!0,isLayout:!0},showCollections:{type:"boolean",title:"admin/editor.productSummary.showCollections.title",default:!1,isLayout:!0},displayMode:{title:"admin/editor.productSummary.displayMode.title",type:"string",enum:["normal","inline"],default:"normal",isLayout:!0},hoverImageLabel:{title:"admin/editor.productSummaryImage.hoverImageLabel.title",description:"admin/editor.productSummaryImage.hoverImageLabel.description",type:"string",default:"",isLayout:!1},hoverImage:{type:"object",properties:{criteria:{title:"admin/editor.productSummaryImage.hoverImage.criteria.title",enum:["index","label"]}},dependencies:{criteria:{oneOf:[{properties:{criteria:{enum:["index"]},index:{title:"admin/editor.productSummaryImage.hoverImage.criteria.index",type:"number"}}},{properties:{criteria:{enum:["label"]},label:{title:"admin/editor.productSummaryImage.hoverImage.criteria.label",type:"string"},labelMatchCriteria:{title:"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria",widget:{"ui:widget":"radio"},type:"string",enum:["exact","contains"],default:"exact"}}}]}}},fetchpriority:{title:"admin/editor.productSummaryImage.fetchpriority.title",enum:["high","low","auto","byPosition"],enumNames:["admin/editor.productSummaryImage.fetchpriority.high","admin/editor.productSummaryImage.fetchpriority.low","admin/editor.productSummaryImage.fetchpriority.auto","admin/editor.productSummaryImage.fetchpriority.byPosition"],widget:{"ui:widget":"radio"},default:"byPosition"}}};t.default=T},20:function(e,t,r){"use strict";function a(e){if(e&&0!==e.length){var t=e.find((function(e){return e.sellerDefault}));return t||e[0]}}r.d(t,"a",(function(){return a}))},22:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return C}));var a=r(11),i=r(37),n=r(20),o=new RegExp(/.+ids\/(\d+)/),u=new RegExp(/http:\/\//);function c(e,t,r){if(!e.includes("/arquivos/ids/"))return e;var a=function(e){var t,r,a,i,n=o.exec(e),u=(r="v",null===(i=null!==(a=null==(t=e)?void 0:t.split("".concat(r,"="))[1])&&void 0!==a?a:"")||void 0===i?void 0:i.split("&")[0]);return n&&n.length>0?{cleanUrl:n[0],vParam:u}:{cleanUrl:e}}(e),i=a.vParam,n=a.cleanUrl;return i?"".concat(n,"-").concat(t,"-").concat(r,"?v=").concat(i):"".concat(n,"-").concat(t,"-").concat(r)}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){"number"==typeof t&&(t=Math.min(t,3e3)),"number"==typeof r&&(r=Math.min(r,4e3));var a=c(e,t,r),i=a.includes("?")?"&":"?";return"".concat(a).concat(i,"width=").concat(t,"&height=").concat(r,"&aspect=true")}}function m(e){return e.commertialOffer.Price}function s(e){var t=e.commertialOffer.AvailableQuantity;return null!=t&&t>0}function d(e,t){var r=e.filter(v);if(0===r.length)return e[0];if(1===r.length)return r[0];var a=r.map((function(e){return function(e,t){var r=e.sellers;if(1===r.length)return r[0].commertialOffer.Price;var a=r.filter(s).map(m);return"highest"===t?a.reduce((function(e,t){return t>e?t:e})):a.reduce((function(e,t){return ta[e]?r:e}),0):a.reduce((function(e,t,r){return t1&&void 0!==arguments[1]?arguments[1]:"FIRST_AVAILABLE",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;if(!e)return null;var l,m=Object.assign({},e),s=m.items||[],d=m.properties||[],p=null!==(t=d.find((function(e){return"DefaultSKUSelected"===e.name})))&&void 0!==t?t:null;if(l=1===s.length?s[0]:p?g(s,p.values,u):h(s,u)){var v=null!==(r=Object(n.a)(null==l?void 0:l.sellers))&&void 0!==r?r:y,C=null!==(i=null==l?void 0:l.referenceId)&&void 0!==i?i:[],I=Object(a.a)(C,1),E=I[0],_=void 0===E?x:E,w=null!==(o=null==l?void 0:l.images)&&void 0!==o?o:[],S=w.map((function(e){return Object.assign(Object.assign({},e),{imageUrl:b(e.imageUrl,c)})})),N=Object(a.a)(S,1),P=N[0],O=void 0===P?f:P;m.sku=Object.assign(Object.assign({},l),{seller:v,referenceId:_,image:O,images:S})}return m}},3:function(e,t,r){e.exports={containerInline:"vtex-product-summary-2-x-containerInline",imageContainer:"vtex-product-summary-2-x-imageContainer",container:"vtex-product-summary-2-x-container",containerSmall:"vtex-product-summary-2-x-containerSmall",containerInlinePrice:"vtex-product-summary-2-x-containerInlinePrice",information:"vtex-product-summary-2-x-information",element:"vtex-product-summary-2-x-element",image:"vtex-product-summary-2-x-image",buyButtonContainer:"vtex-product-summary-2-x-buyButtonContainer",buyButton:"vtex-product-summary-2-x-buyButton",description:"vtex-product-summary-2-x-description",quantityStepperContainer:"vtex-product-summary-2-x-quantityStepperContainer",imageInline:"vtex-product-summary-2-x-imageInline",isHidden:"vtex-product-summary-2-x-isHidden",containerNormal:"vtex-product-summary-2-x-containerNormal",nameContainer:"vtex-product-summary-2-x-nameContainer",clearLink:"vtex-product-summary-2-x-clearLink",aspectRatio:"vtex-product-summary-2-x-aspectRatio",priceContainer:"vtex-product-summary-2-x-priceContainer",SKUSelectorContainer:"vtex-product-summary-2-x-SKUSelectorContainer",attachmentListContainer:"vtex-product-summary-2-x-attachmentListContainer",attachmentItemContainer:"vtex-product-summary-2-x-attachmentItemContainer",imageNormal:"vtex-product-summary-2-x-imageNormal",addToListBtn:"vtex-product-summary-2-x-addToListBtn",imagePlaceholder:"vtex-product-summary-2-x-imagePlaceholder",attachmentChildrenContainer:"vtex-product-summary-2-x-attachmentChildrenContainer",imageStackContainer:"vtex-product-summary-2-x-imageStackContainer",hoverEffect:"vtex-product-summary-2-x-hoverEffect",hoverImage:"vtex-product-summary-2-x-hoverImage",mainImageHovered:"vtex-product-summary-2-x-mainImageHovered",priceSpinner:"vtex-product-summary-2-x-priceSpinner",spin:"vtex-product-summary-2-x-spin",sponsoredBadgeContainer:"vtex-product-summary-2-x-sponsoredBadgeContainer",sponsoredBadgeText:"vtex-product-summary-2-x-sponsoredBadgeText"}},38:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},40:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/CollectionBadges"]},41:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/DiscountBadge"]},42:function(e,t,r){"use strict";var a=r(0),i=r.n(a);t.a=function(e){var t=e.cssHandle;return i.a.createElement("div",{className:"relative"},i.a.createElement("div",{className:"".concat(t," absolute w-100 h-100 contain bg-center")}),i.a.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"image-placeholder"},i.a.createElement("rect",{width:"512",height:"512",fill:"#F2F2F2"}),i.a.createElement("rect",{x:"183.857",y:"180.2",width:"144.286",height:"150.474",stroke:"#CACBCC",strokeWidth:"2"}),i.a.createElement("path",{d:"M183.78 303.688H328.214",stroke:"#CACBCC",strokeWidth:"2"}),i.a.createElement("path",{d:"M205.082 279.563L223.599 240.507L242.116 260.035L269.892 220.979L306.926 279.563H205.082Z",stroke:"#CACBCC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i.a.createElement("path",{d:"M252.225 213.939C252.225 219.822 247.66 224.52 242.114 224.52C236.569 224.52 232.004 219.822 232.004 213.939C232.004 208.057 236.569 203.359 242.114 203.359C247.66 203.359 252.225 208.057 252.225 213.939Z",stroke:"#CACBCC",strokeWidth:"2"})))}},5:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},53:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/useDevice"]},6:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-summary-context@0.x/ProductSummaryContext"]},63:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.responsive-values@0.x/useResponsiveValues"]},7:function(e,t){e.exports=Classnames},88:function(e,t,r){"use strict";r.r(t),function(e){var t=r(4);r.p=Object(t.getPublicPath)("vtex.product-summary@2.91.0");var a=Object(t.register)((function(){return r(108)}),e,"vtex.product-summary@2.91.0","vtex.product-summary@2.x","ProductSummaryImage");a.renderHotReload,a.setupHMR}.call(this,r(13)(e))}},[[88,"common"]]]);